<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <head th:replace="/common/layout :: header(~{::title},~{::link},~{::style})"></head>
    <body>
        <div style="margin: 15px;" class="fadeInUp animated">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>编辑权限</legend>
            </fieldset>
            <blockquote class="layui-elem-quote">
                1、权限链接; 例如 /menu/index<br/>
                2、权限编码; 例如 sys:menu:query
            </blockquote>
            <form class="layui-form layui-form-pane">
                <div class="layui-form-item">
                    <label class="layui-form-label">父级</label>
                    <div class="layui-input-4">
                        <select name="parentId" lay-verify="required" lay-filter="parentId" >
                            <option value="0" th:selected="${info.getParentId() eq 0}">默认顶级</option>
                            <option th:each="menu:${menuList}" th:value="${menu.menuId}" th:selected="${menu.menuId eq info.getParentId()}">[[${menu.leftHtml}]][[${menu.menuName}]]</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">权限名称</label>
                    <div class="layui-input-4">
                        <input type="text" name="menuName" th:value="${info.getMenuName()}" lay-verify="required" placeholder="请输入权限名称" class="layui-input" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">权限编码</label>
                    <div class="layui-input-4">
                        <input type="text" name="perms" th:value="${info.getPerms()}" lay-verify="required" placeholder="请输入权限编码" class="layui-input" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">权限链接</label>
                    <div class="layui-input-4">
                        <input type="text" name="menuUrl" th:value="${info.getMenuUrl()}" lay-verify="required" placeholder="请输入权限链接" class="layui-input" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">图标名称</label>
                    <div class="layui-input-4">
                        <input type="text" name="icon" th:value="${info.getIcon()}" placeholder="请输入图标名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">启用状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" lay-filter="status" th:checked="${info.getStatus() eq 1}" value="1" title="开启">
                        <input type="radio" name="status" lay-filter="status" th:checked="${info.getStatus() eq 0}" value="0" title="关闭">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">菜单显示</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isView" lay-filter="isView" th:checked="${info.getIsView() eq 1}" value="1" title="开启">
                        <input type="radio" name="isView" lay-filter="isView" th:checked="${info.getIsView() eq 0}" value="0" title="关闭">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否外链</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isLink" lay-filter="isLink" th:checked="${info.getIsLink() eq 1}" value="1" title="开启">
                        <input type="radio" name="isLink" lay-filter="isLink" th:checked="${info.getIsLink() eq 0}" value="0" title="关闭">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">类型</label>
                    <div class="layui-input-block">
                        <input type="radio" name="menuType" lay-filter="menuType" th:checked="${info.getMenuType() eq 1}" value="1" title="菜单">
                        <input type="radio" name="menuType" lay-filter="menuType" th:checked="${info.getMenuType() eq 2}" value="2" title="按钮">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-2">
                        <input type="text" name="sort" th:value="${info.getSort()}" placeholder="请输入排序编号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="hidden" name="menuId" th:value="${info.getMenuId()}">
                        <button type="button" class="layui-btn" lay-submit="" lay-filter="add-btn">立即提交</button>
                        <a href="javascript:goMenuIndex();" class="layui-btn layui-btn-primary">返回</a>
                    </div>
                </div>
            </form>
        </div>
        <script th:replace="/common/layout :: bottom-script"></script>
        <script th:inline="javascript">
            var postUrl = apiRouter.menuEdit;

        </script>
        <script th:src="@{/admin/js/menu/menu.js}" charset="utf-8"></script>
    </body>
</html>